import { DeviceType, XboxInput } from "@babylonjs/core/DeviceInput/InputDevices/deviceEnums";
import { DeviceInputKey } from "../device-information";
import { InputKeyStatus } from "../input-key-status";
import { DeviceSource } from "@babylonjs/core/DeviceInput/InputDevices/deviceSource";


/**
 * @internal
 * 生成xbox手柄预设
 * @param device 设备源
 * @returns xbox手柄预设
 */
const XboxPreset = (device: DeviceSource<DeviceType.Xbox>) => {
    return {
        A: new InputKeyStatus(DeviceInputKey.xboxA, XboxInput.A, device),
        B: new InputKeyStatus(DeviceInputKey.xboxB, XboxInput.B, device),
        back: new InputKeyStatus(DeviceInputKey.xboxBack, XboxInput.Back, device),
        DPadDown: new InputKeyStatus(DeviceInputKey.xboxDPadDown, XboxInput.DPadDown, device),
        DPadLeft: new InputKeyStatus(DeviceInputKey.xboxDPadLeft, XboxInput.DPadLeft, device),
        DPadRight: new InputKeyStatus(DeviceInputKey.xboxDPadRight, XboxInput.DPadRight, device),
        DPadUp: new InputKeyStatus(DeviceInputKey.xboxDPadUp, XboxInput.DPadUp, device),
        Home: new InputKeyStatus(DeviceInputKey.xboxHome, XboxInput.Home, device),
        LB: new InputKeyStatus(DeviceInputKey.xboxLB, XboxInput.LB, device),
        LS: new InputKeyStatus(DeviceInputKey.xboxLS, XboxInput.LS, device),
        LStickXAxis: new InputKeyStatus(DeviceInputKey.xboxLStickXAxis, XboxInput.LStickXAxis, device),
        LStickYAxis: new InputKeyStatus(DeviceInputKey.xboxLStickYAxis, XboxInput.LStickYAxis, device),
        LT: new InputKeyStatus(DeviceInputKey.xboxLT, XboxInput.LT, device),
        RB: new InputKeyStatus(DeviceInputKey.xboxRB, XboxInput.RB, device),
        RS: new InputKeyStatus(DeviceInputKey.xboxRS, XboxInput.RS, device),
        RStickXAxis: new InputKeyStatus(DeviceInputKey.xboxRStickXAxis, XboxInput.RStickXAxis, device),
        RStickYAxis: new InputKeyStatus(DeviceInputKey.xboxRStickYAxis, XboxInput.RStickYAxis, device),
        RT: new InputKeyStatus(DeviceInputKey.xboxRT, XboxInput.RT, device),
        Start: new InputKeyStatus(DeviceInputKey.xboxStart, XboxInput.Start, device),
        X: new InputKeyStatus(DeviceInputKey.xboxX, XboxInput.X, device),
        Y: new InputKeyStatus(DeviceInputKey.xboxY, XboxInput.Y, device),
    };
};


export { XboxPreset };